package com.shark.manager.system.model;

import java.util.Date;

import org.apache.shiro.crypto.SecureRandomNumberGenerator;

import com.shark.commons.utils.PropertyUtils;

public class User {
    private Long id;

    private String account;

    private String password;

    private String salt;

    private String truename;

    private String spell;

    private String gender;

    private Date birthday;

    private String mobile;

    private String telephone;

    private String email;

    private Integer loginCount;

    private Date firstVisit;

    private Date previousVisit;

    private Date lastVisit;

    private String remark;

    private Integer locked;

    private String iforgot_signature;

    private Date iforgot_expires;

    private Date change_pass_date;

    private Date create_time;

    private Long create_user_id;

    private String create_username;

    private Date modify_time;

    private Long modify_user_id;

    private String modify_username;

    
    private String quickSearch ;
    
    /**
     * 项目加密盐
     */
    private static String AppSalt = PropertyUtils.getValue("shiro.applicationSalt");
    
    /**
     * 随机加密盐
     */
    public void setRandomSalt() {
    	setSalt(new SecureRandomNumberGenerator().nextBytes().toHex());
    }
    
    /**
     * 组合加密盐
     * 项目加密盐+用户名+随机岁加密盐
     * @return
     */
    public String getCredentialsSalt() {
    	if(null != getSalt()) {
    		return AppSalt + getSalt() ;
    	} 
    	return null;
    }
    

    public String getQuickSearch() {
		return quickSearch;
	}

	public void setQuickSearch(String quickSearch) {
		this.quickSearch = quickSearch;
	}
    
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getTruename() {
        return truename;
    }

    public void setTruename(String truename) {
        this.truename = truename;
    }

    public String getSpell() {
        return spell;
    }

    public void setSpell(String spell) {
        this.spell = spell;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Integer getLoginCount() {
        return loginCount;
    }

    public void setLoginCount(Integer loginCount) {
        this.loginCount = loginCount;
    }

    public Date getFirstVisit() {
        return firstVisit;
    }

    public void setFirstVisit(Date firstVisit) {
        this.firstVisit = firstVisit;
    }

    public Date getPreviousVisit() {
        return previousVisit;
    }

    public void setPreviousVisit(Date previousVisit) {
        this.previousVisit = previousVisit;
    }

    public Date getLastVisit() {
        return lastVisit;
    }

    public void setLastVisit(Date lastVisit) {
        this.lastVisit = lastVisit;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getLocked() {
        return locked;
    }

    public void setLocked(Integer locked) {
        this.locked = locked;
    }

    public String getIforgot_signature() {
        return iforgot_signature;
    }

    public void setIforgot_signature(String iforgot_signature) {
        this.iforgot_signature = iforgot_signature;
    }

    public Date getIforgot_expires() {
        return iforgot_expires;
    }

    public void setIforgot_expires(Date iforgot_expires) {
        this.iforgot_expires = iforgot_expires;
    }

    public Date getChange_pass_date() {
        return change_pass_date;
    }

    public void setChange_pass_date(Date change_pass_date) {
        this.change_pass_date = change_pass_date;
    }

    public Date getCreate_time() {
        return create_time;
    }

    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }

    public Long getCreate_user_id() {
        return create_user_id;
    }

    public void setCreate_user_id(Long create_user_id) {
        this.create_user_id = create_user_id;
    }

    public String getCreate_username() {
        return create_username;
    }

    public void setCreate_username(String create_username) {
        this.create_username = create_username;
    }

    public Date getModify_time() {
        return modify_time;
    }

    public void setModify_time(Date modify_time) {
        this.modify_time = modify_time;
    }

    public Long getModify_user_id() {
        return modify_user_id;
    }

    public void setModify_user_id(Long modify_user_id) {
        this.modify_user_id = modify_user_id;
    }

    public String getModify_username() {
        return modify_username;
    }

    public void setModify_username(String modify_username) {
        this.modify_username = modify_username;
    }
}